import numpy as np
import pandas as pd
import warnings
import geopandas as gpd
import cartopy.io.img_tiles as cimgt
import cartopy.feature as cfeature
import xarray as xr
import matplotlib as mpl
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
import altair as alt
import cartopy.crs as ccrs
import os
import re
import shapefile as shp
import seaborn as sns
from datetime import datetime
C:\Users\pmarshal\Anaconda3\lib\site-packages\geopandas\_compat.py:123: UserWarning: The Shapely GEOS version (3.8.0-CAPI-1.13.1 ) is incompatible with the GEOS version PyGEOS was compiled with (3.10.4-CAPI-1.16.2). Conversions between both will be slow.
warnings.warn(
sites = pd.read_csv('data/sites.csv')
sites
| Site | Lat | Long | |
|---|---|---|---|
| 0 | Lower Capilano Fire Weather | 49.38694 | -123.11968 |
| 1 | Capilano River at Lakehead | 49.39647 | -123.14542 |
| 2 | Capilano Fire Weather | 49.44496 | -123.10402 |
| 3 | Lower Seymour Fire Weather | 49.37925 | -122.99552 |
| 4 | Seymour Fire Weather | 49.48584 | -122.94626 |
| 5 | Seymour River at Orchid | 49.52026 | -123.00398 |
| 6 | Orchid Lake | 49.53588 | -123.05076 |
| 7 | Palisade Lake | 49.45446 | -123.03179 |
| 8 | Burwell Lake | 49.45750 | -122.99500 |
| 9 | Loch Lomond | 49.58988 | -123.03750 |
| 10 | Coquitlam Fire Weather | 49.36409 | -122.75339 |
| 11 | Disappointment Lake | 49.55448 | -122.75861 |
| 12 | Coquitlam Glacier | 49.50750 | -122.72020 |
points = gpd.GeoDataFrame(
sites, geometry=gpd.points_from_xy(sites.Long, sites.Lat))
points.head(10)
| Site | Lat | Long | geometry | |
|---|---|---|---|---|
| 0 | Lower Capilano Fire Weather | 49.38694 | -123.11968 | POINT (-123.11968 49.38694) |
| 1 | Capilano River at Lakehead | 49.39647 | -123.14542 | POINT (-123.14542 49.39647) |
| 2 | Capilano Fire Weather | 49.44496 | -123.10402 | POINT (-123.10402 49.44496) |
| 3 | Lower Seymour Fire Weather | 49.37925 | -122.99552 | POINT (-122.99552 49.37925) |
| 4 | Seymour Fire Weather | 49.48584 | -122.94626 | POINT (-122.94626 49.48584) |
| 5 | Seymour River at Orchid | 49.52026 | -123.00398 | POINT (-123.00398 49.52026) |
| 6 | Orchid Lake | 49.53588 | -123.05076 | POINT (-123.05076 49.53588) |
| 7 | Palisade Lake | 49.45446 | -123.03179 | POINT (-123.03179 49.45446) |
| 8 | Burwell Lake | 49.45750 | -122.99500 | POINT (-122.99500 49.45750) |
| 9 | Loch Lomond | 49.58988 | -123.03750 | POINT (-123.03750 49.58988) |
# import shapefiles using geopandas
cap_boundary = gpd.read_file('data/CapilanoWatershed.shp')
coq_boundary = gpd.read_file('data/CoquitlamWatershed.shp')
sey_boundary = gpd.read_file('data/SeymourWatershed.shp')
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import folium
m = folium.Map(location=[49.42518, -123.000], zoom_start=11)
folium.GeoJson(
data=cap_boundary["geometry"]).add_to(m)
folium.GeoJson(
data=coq_boundary["geometry"]).add_to(m)
folium.GeoJson(
data=sey_boundary["geometry"]).add_to(m)
for site in sites["Site"].unique():
site_loc = sites[sites["Site"]==site]
folium.CircleMarker(
location=[site_loc.Lat.values[0], site_loc.Long.values[0]],
tooltip = site_loc.Site.values[0],
radius = 5,
color="blue",
fill_color="blue"
).add_to(m)
m
Make this Notebook Trusted to load map: File -> Trust Notebook